/**
 * 
 */
package com.skyline.common.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * @author skyline
 *
 */
public class RatyStarsTag extends TagSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3248516773384986868L;

	/**
	 * 评分对象ID
	 */
	private Long objId;
	/**
	 * 初始星级
	 */
	private Integer startStar;
	/**
	 * 是否使用大图标
	 */
	private Boolean isBig;
	private Boolean isReadOnly;
	private String objType;

	public Long getObjId() {
		return objId;
	}
	public void setObjId(Long objId) {
		this.objId = objId;
	}
	public Integer getStartStar() {
		return startStar;
	}
	public void setStartStar(Integer startStar) {
		this.startStar = startStar;
	}
	
	public Boolean getIsBig() {
		return isBig;
	}
	public void setIsBig(Boolean isBig) {
		this.isBig = isBig;
	}
	public Boolean getIsReadOnly() {
		return isReadOnly;
	}
	public void setIsReadOnly(Boolean isReadOnly) {
		this.isReadOnly = isReadOnly;
	}
	public String getObjType() {
		return objType;
	}
	public void setObjType(String objType) {
		this.objType = objType;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	@Override
	public int doEndTag() throws JspException {
		try {
			pageContext.getOut().println(getRatyStarTag());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return EVAL_BODY_INCLUDE;
	}
	public String getRatyStarTag(){
		String tagContent="";
	//	tagContent+="<script type=\"text/javascript\">";
	//	tagContent+="jQuery(\"document\").ready(function(){Attention.ajaxIsAttention(\""+idolId+"\"); alert();});";
	//	tagContent+="<a href='javascript:Attention.payAttention(\""+idolId+"\",\""+idolNickname+"\",\""+idolPortrait+"\",\""+idolType+"\")' ";
	//	tagContent+="'>关注测试 </a>";
	//	tagContent+="</script>";
	//	tagContent+= "< input id='"+"attention"+"' type='"+"button"+"' name='"+"attention"+"' value='"+"取消关注"+"' onclick='"+""+"'>";
		tagContent+="<div id=ratyStar_"+objId+">";
		tagContent+="</div>";
		tagContent+="<script type=\"text/javascript\">";
		tagContent+="jQuery(\"document\").ready(function(){ratyStar.initRatyStar(\""+objId+"\",\""+startStar+"\",\""+objType+"\",\""+isReadOnly+"\",\""+isBig+"\");});";
		tagContent+="</script>";
		return tagContent;
	}


}
